﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace sand_game_core
{
    public class Stone : particle
    {
        public Stone(uint x, uint y, int startLight)
            : base(new Microsoft.Xna.Framework.Color(169 + random.rnd.Next(38), 169 + random.rnd.Next(38), 166 + random.rnd.Next(32)), startLight)
        {
            base.x = x;
            base.y = y;
            base.active = false;
        }
        public override void update()
        {
            downParticle = y >= 1 ? world.worldParticleLayer[x * world.arraywidth + y - 1] : null;
            if (downParticle == null || downParticle is Water)
            {
                world.swap(x, y, x, y - 1);
            }
            else
            {
                active = false;
            }
        }

        public override void lightMe()
        {
                light -= light >= 3 ? 3 : 0;
        }
        public override void reactivate()
        {
        }
    }
}